<template>
  <div>
    <el-button
      :class="row.handleState?'disabled-button':''"
      :disabled="row.handleState"
      icon="el-icon-circle-plus-outline"
      size="mini"
      type="text"
      @click="doClaim(row)"
    >签收
    </el-button>
    <el-button
      :class="!row.handleState ?'disabled-button':''"
      :disabled="!row.handleState"
      icon="el-icon-circle-check"
      size="mini"
      type="text"
      @click="doApproval"
    >审核
    </el-button>
  </div>
</template>

<script>

  import { claim } from '@/api/activiti/task'

  export default {
    name: 'ClaimButton',
    props: {
      row: {
        required: true,
        type: Object
      }
    },
    data() {
      return {

      }
    },
    methods: {
      doApproval() {
        this.$emit('approval');
      },
      // 签收
      doClaim(row) {
        claim(row.taskId).then(res => {
          if (res && res.code === 200) {
            this.msgSuccess("签收成功")
            this.$emit('refreshDataList')
          }
        });
      }
    }
  }
</script>

<style scoped>

</style>
